<%@ page contentType="text/html; charset=UTF-8" import="com.pub.database.DBFunction,com.pub.database.QueryBean,com.pub.web.WebFunction"%>
<%
QueryBean qbnDAO = null;
String strDBAlias = "PIS1_SWD";
String strUserName = strDBAlias.substring(strDBAlias.indexOf("_")+1);
String strTableName = "WKF_LAYOUT";
String strDbUserHtml = null;
String strDbObjectsHtml = null;
String strTableColumnHtml = null;
String strTablePKHtml = null;
String strTableFKHtml = null;
String strTableIndexHtml = null;

try{
  qbnDAO = new QueryBean(strDBAlias,true,"big5","big5");

  strTablePKHtml = WebFunction.transferToHtmlTable(DBFunction.getTablePrimaryKey(qbnDAO.getConnection().getMetaData(),true,strUserName,strTableName),"id='tblTablePrimaryKey' border='1' cellspacing='0' cellpadding='0'");
  strDbUserHtml = WebFunction.transferToHtmlTable(DBFunction.getDBUsers(qbnDAO.getConnection().getMetaData(),true),"id='tblDBUser' border='1' cellspacing='0' cellpadding='0'");
  strDbObjectsHtml = WebFunction.transferToHtmlTable(DBFunction.getDBObjects(qbnDAO.getConnection().getMetaData(),true,strUserName,null),"id='tblDBObject' border='1' cellspacing='0' cellpadding='0'");
  strTableColumnHtml = WebFunction.transferToHtmlTable(DBFunction.getTableColumns(qbnDAO.getConnection().getMetaData(),true,strUserName,strTableName),"id='tblTableColumn' border='1' cellspacing='0' cellpadding='0'");
  strTableFKHtml = WebFunction.transferToHtmlTable(DBFunction.getTableForeignKey(qbnDAO.getConnection().getMetaData(),true,strUserName,strTableName),"id='tblTableForeignKey' border='1' cellspacing='0' cellpadding='0'");
  strTableIndexHtml = WebFunction.transferToHtmlTable(DBFunction.getIndexInfo(qbnDAO.getConnection().getMetaData(),true,strUserName,strTableName),"id='tblTableIndex' border='1' cellspacing='0' cellpadding='0'");
}
catch(Exception e){
  e.printStackTrace();
}
finally{
  if(qbnDAO!=null){
    try{qbnDAO.close();qbnDAO=null;}catch(Exception e){e.printStackTrace();}
  }
}

%>
<html>
<head>
<title>
testDBInfo
</title>
</head>
<body bgcolor="#ffffff">
<p><%=strDBAlias%> All User List<br /><%=strDbUserHtml%></p>
<p><%=strUserName%> Object List<br /><%=strDbObjectsHtml%></p>
<p>Table <%=strTableName%> Column List<br /><%=strTableColumnHtml%></p>
<p>Table <%=strTableName%> Primary Key<br /><%=strTablePKHtml%></p>
<p>Table <%=strTableName%> Foreign Key<br /><%=strTableFKHtml%></p>
<p>Table <%=strTableName%> Index<br /><%=strTableIndexHtml%></p>
</body>
</html>
